<template>
  <div id="app">
    <Header />
    <!-- 路由组件出口的地方 -->
    <router-view></router-view>
    <GoTop />
    <Music></Music>
    <Toast v-show="isShowLoginAgreeModal"></Toast>
    <MyFooter v-show="isShowFoot" />
  </div>
</template>

<script>
import Header from "@/components/Header";
import MyFooter from "@/components/MyFooter/Footer.vue";
import GoTop from "@/components/GoTop";
import Music from "@/components/Music";
import Toast from "@/components/Toast";
import { mapState } from "vuex";
export default {
  name: "App",
  components: {
    Header,
    MyFooter,
    Toast,
    GoTop,
    Music,
  },
  data() {
    return {
      isShowFoot: true,
    };
  },
  computed: {
    path() {
      return this.$route.path;
    },
    ...mapState({
      isShowLoginAgreeModal: (state) =>
        state.showLoginAgreeModal.isShowLoginAgreeModal,
    }),
  },
  watch: {
    path() {
      if (this.$route.path.indexOf("/mymusic") != -1) this.isShowFoot = false;
      else this.isShowFoot = true;
    },
  },
};
</script>

<style lang="less" scoped>
#app {
  width: 100%;
  background: #f5f5f5;
}
/* 清除浮动 */
.clearfix {
  zoom: 1;
}
.clearfix:after {
  content: "";
  display: block;
  height: 0;
  clear: both;
}
/* 超出部分省略号表示 */
.over {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 鼠标移入显示下划线 */
.underline:hover {
  text-decoration: underline;
  cursor: pointer;
}
/* 鼠标移入变为手指 */
.pointer:hover {
  cursor: pointer;
}
/* 文字无法被选中 */
.notChoose {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
</style>
